package flyweight.example;

/**
 * @author cheng:
 * @date 2019/4/25 11:12
 */
public class Test {
    public static void main(String[] args) {
        WebsiteFactory factory = new WebsiteFactory();

        Website fx = factory.getWebsiteCategory("产品展示");
        fx.use(new User("小菜"));

        Website fy = factory.getWebsiteCategory("产品展示");
        fy.use(new User("大鸟"));

        Website fz = factory.getWebsiteCategory("产品展示");
        fz.use(new User("娇娇"));

        Website fl = factory.getWebsiteCategory("博客");
        fl.use(new User("老顽童"));

        Website fm = factory.getWebsiteCategory("博客");
        fm.use(new User("桃谷六仙"));

        Website fn = factory.getWebsiteCategory("博客");
        fn.use(new User("海南神鳄"));

        System.out.println("网站分类总数：" + factory.getWebsiteCount());
    }
}
